﻿using System;
using System.Collections.Generic;
using FBGraph.Models;
using Newtonsoft.Json;

namespace FBGraph.Controllers
{
    public partial class AlbumsController : IFBGraphPrimaryController<Album>
    {
        /// <summary>Creates an album with the specified <paramref name="name" /> and <paramref name="message" />.</summary>
        /// <param name="profileId">The Graph API identifier of the profile (<see cref="User" /> or <see cref="Page" />) for which to create the album.</param>
        /// <param name="name">The name of the album.</param>
        /// <param name="description">An optional description of the album.</param>
        /// <returns>The Graph API identifier of the created album.</returns>
        public Object Create(Object profileId, String name, String description)
        {
            var args = new FBArgs 
            {
                { "name", name },
                { "message", description }
            };

            var result = Context.Post(profileId, "albums", args);

            return result.Id;
        }
    }
}